CREATE TABLE `SRAnalytics`.`MsgLiveSurfaceAtm` (
`ekey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None',
`ekey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None',
`ekey_tk` VARCHAR(12) NOT NULL DEFAULT '',
`ekey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`ticker_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'underlying stock key that this option expiration attaches to',
`ticker_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'underlying stock key that this option expiration attaches to',
`ticker_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'underlying stock key that this option expiration attaches to',
`fkey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'future that this option expiration month written on (if any)',
`fkey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'future that this option expiration month written on (if any)',
`fkey_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'future that this option expiration month written on (if any)',
`fkey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'future that this option expiration month written on (if any)',
`fkey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'future that this option expiration month written on (if any)',
`fkey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'future that this option expiration month written on (if any)',
`uBid` DOUBLE NOT NULL DEFAULT 0 COMMENT 'underlier bid price',
`uAsk` DOUBLE NOT NULL DEFAULT 0 COMMENT 'underlier ask price',
`years` FLOAT NOT NULL DEFAULT 0 COMMENT 'time to expiration (in years)',
`rate` FLOAT NOT NULL DEFAULT 0 COMMENT 'interest rate',
`sdiv` FLOAT NOT NULL DEFAULT 0 COMMENT 'stock dividend (borrow rate)',
`ddiv` FLOAT NOT NULL DEFAULT 0 COMMENT 'present value of discrete dividend stream',
`exType` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'exercise type of the options used to compute this surface',
`modelType` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'option pricing model used for price calcs',
`earnCnt` FLOAT NOT NULL DEFAULT 0 COMMENT 'number of qualifying earnings events prior to expiration [can be fractional] (from StockEarningsCalendar)',
`earnCntAdj` FLOAT NOT NULL DEFAULT 0 COMMENT 'number of qualifying earnings events prior to expiration [adjusted] (from StockEarningsCalendar + LiveSurfaceTerm)',
`axisVolRT` FLOAT NOT NULL DEFAULT 0 COMMENT 'axis volatility x sqrt(years) (used to compute xAxis) [usually 4m atm vol]',
`axisFUPrc` FLOAT NOT NULL DEFAULT 0 COMMENT 'axis FwdUPrc (fwd underlying price used to compute xAxis)',
`moneynessType` ENUM('None','PctStd','LogStd','NormStd') NOT NULL DEFAULT 'None' COMMENT 'moneyness (xAxis) convention',
`underlierMode` ENUM('None','Actual','FrontMonth','UPrcAdj') NOT NULL DEFAULT 'None' COMMENT 'underlier pricing mode (None=use spot/stock market; FrontMonth=use front month future market * uPrcRatio; Actual = use actual underlier future market)',
`priceQuoteType` ENUM('None','Price','Vol') NOT NULL DEFAULT 'None' COMMENT 'Price or Vol',
`atmVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'atm vol (xAxis = 0)',
`atmCen` FLOAT NOT NULL DEFAULT 0 COMMENT 'atm vol (xAxis = 0) (eMove/earnCntAdj censored)',
`atmVolHist` FLOAT NOT NULL DEFAULT 0 COMMENT 'historical realized volatility (includes eMoveHist x earnCntAdj adjustment). Note that this is the default atmVol if no implied markets existed previous day.',
`atmCenHist` FLOAT NOT NULL DEFAULT 0 COMMENT 'censored (earnings events removed) historical realized volatility. Trailing periods is 2x forward time to expiration. From HistoricalVolatility(windowType=hlCen).mv_nnn',
`minAtmVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'minimum estimated atm vol',
`maxAtmVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'maximum estimated atm vol',
`eMove` FLOAT NOT NULL DEFAULT 0 COMMENT 'implied earnings move (from LiveSurfaceTerm)',
`eMoveHist` FLOAT NOT NULL DEFAULT 0 COMMENT 'historical earnings move (avg of trailing 8 moves). From StockEarningsCalendar.eMoveHist',
`atmMove` FLOAT NOT NULL DEFAULT 0 COMMENT 'fixed strike atm move from prior period',
`atmCenMove` FLOAT NOT NULL DEFAULT 0 COMMENT 'fixed strike atm (censored) move from prior period',
`atmPhi` FLOAT NOT NULL DEFAULT 0 COMMENT 'surface phi @ xAxis = 0',
`atmVega` FLOAT NOT NULL DEFAULT 0 COMMENT 'surface vega @ xAxis = 0',
`slope` FLOAT NOT NULL DEFAULT 0 COMMENT 'volatility surface slope (dVol / dXAxis) @ ATM (xAxis=0)',
`varSwapFV` FLOAT NOT NULL DEFAULT 0 COMMENT 'variance swap fair value (estimated by numerical integration over OTM price surface)',
`gridType` ENUM('None','Unused','SRCubic','SRCubic2','BSpline','BSpline2') NOT NULL DEFAULT 'None' COMMENT 'gridType defines D11 - U12 xAxis points + spline type',
`minXAxis` FLOAT NOT NULL DEFAULT 0 COMMENT 'minimum xAxis value; xAxis values to the left extrapolate horizontally',
`maxXAxis` FLOAT NOT NULL DEFAULT 0 COMMENT 'maximum xAxis value; xAxis values to the right extrapolate horizontally',
`minCurvValue` FLOAT NOT NULL DEFAULT 0 COMMENT 'minimum curvature (2nd derivative) of skew curve (can be negative if curve is not strictly convex)',
`minCurvXAxis` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis of minimum curvature point',
`maxCurvValue` FLOAT NOT NULL DEFAULT 0 COMMENT 'maximum curvature (2nd derivative) of skew curve',
`maxCurvXAxis` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis of maximum curvature point',
`skewMinX` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis = (effStrike / effAxisFUPrc - 1.0) / axisVolRT; effStrike = strike * strikeRatio; effAxisFUPrc = axisFUPrc * symbolRatio',
`skewMinY` FLOAT NOT NULL DEFAULT 0 COMMENT 'skewMinX / skewMinY are the skew curve minimum point (usually a positive x value and a negative y value)',
`skewD11` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D11 point (volatility skew curve)',
`skewD10` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D10 point',
`skewD9` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D9 point',
`skewD8` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D8 point',
`skewD7` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D7 point',
`skewD6` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D6 point',
`skewD5` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D5 point',
`skewD4` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D4 point',
`skewD3` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D3 point',
`skewD2` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D2 point',
`skewD1` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ D1 point',
`skewC0` FLOAT NOT NULL DEFAULT 0 COMMENT 'central value (@xAxis = 0) [usually zero]',
`skewU1` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U1 point',
`skewU2` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U2 point',
`skewU3` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U3 point',
`skewU4` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U4 point',
`skewU5` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U5 point',
`skewU6` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U6 point',
`skewU7` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U7 point',
`skewU8` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U8 point',
`skewU9` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U9 point',
`skewU10` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U10 point',
`skewU11` FLOAT NOT NULL DEFAULT 0 COMMENT 'skew @ U11 point',
`sdivD3` FLOAT NOT NULL DEFAULT 0 COMMENT 'sdiv @ D3 point',
`sdivD2` FLOAT NOT NULL DEFAULT 0 COMMENT 'sdiv @ D2 point',
`sdivD1` FLOAT NOT NULL DEFAULT 0 COMMENT 'sdiv @ D1 point',
`sdivU1` FLOAT NOT NULL DEFAULT 0 COMMENT 'sdiv @ U1 point',
`sdivU2` FLOAT NOT NULL DEFAULT 0 COMMENT 'sdiv @ U2 point',
`sdivU3` FLOAT NOT NULL DEFAULT 0 COMMENT 'sdiv @ U3 point',
`pwidth` FLOAT NOT NULL DEFAULT 0 COMMENT 'minimum mkt premium width',
`vwidth` FLOAT NOT NULL DEFAULT 0 COMMENT 'minimum mkt volatility width',
`cCnt` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'num call strikes',
`pCnt` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'num put strikes',
`cBidMiss` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of call bid violations (surface outside the market)',
`cAskMiss` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of call ask violations (surface outside the market)',
`pBidMiss` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of put bid violations',
`pAskMiss` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of put ask violations',
`fitAvgErr` FLOAT NOT NULL DEFAULT 0 COMMENT 'surface fit R2 (mid-market values)',
`fitAvgAbsErr` FLOAT NOT NULL DEFAULT 0 COMMENT 'mean square error (mid-market values)',
`fitMaxPrcErr` FLOAT NOT NULL DEFAULT 0 COMMENT 'worst case surface premium violation',
`fitErrXX` FLOAT NOT NULL DEFAULT 0 COMMENT 'okey_xx of the option with the largest fit error in this expiration',
`fitErrCP` ENUM('Call','Put','Pair') NOT NULL DEFAULT 'Call' COMMENT 'okey_cp of the option with the largest fit error in this expiration',
`fitErrDe` FLOAT NOT NULL DEFAULT 0 COMMENT 'delta of fixErrXX',
`fitErrBid` FLOAT NOT NULL DEFAULT 0 COMMENT 'bid of the option with the largest fit error',
`fitErrAsk` FLOAT NOT NULL DEFAULT 0 COMMENT 'ask of the option with the largest fit error',
`fitErrPrc` FLOAT NOT NULL DEFAULT 0 COMMENT 'surface prc of the option with the largest fit error',
`fitErrVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'surface vol of the option with the largest fit error',
`counter` INT NOT NULL DEFAULT 0 COMMENT 'message counter - number of surface fits today',
`skewCounter` INT NOT NULL DEFAULT 0 COMMENT 'skew surface fit counter',
`sdivCounter` INT NOT NULL DEFAULT 0 COMMENT 'sdiv surface fit counter',
`tradingSession` ENUM('None','RegularMkt','PreMkt','PostMkt','PostMktETF','NextDay','MktClosed','Rotation') NOT NULL DEFAULT 'None' COMMENT 'trading session this surface is from',
`tradeableStatus` ENUM('None','OK','SurfaceErr','LowCCnt','LowPCnt','FitPrcErr','BidAskMiss','LowCounter','DefaultSkew','SessionMiss','BaseErr','SwitchDelay','WideMktV','WideMktP','WideUMkt','UWidthEma','CCntEma','PCntEma','VWidthEma','PWidthEma','Closed') NOT NULL DEFAULT 'None' COMMENT 'indicates whether the surface is currently tradeable or not (all server surface integrity checks pass)',
`surfaceResult` ENUM('None','OK','EOD','Init','Cache','PrevDay','NullExpIdx','NoStrikes','NoBaseCurve','BadBootAtm','NoGoodStrikes','BadAtmVol','Bootstrap','NoUPrc','NoIVols','NoModelPts','ZeroYears','NoSimpleVol','OptMktNotOpn','NoBaseSurface','UPrcOffCnt','SkewKnotCnt','Exception','AxisError','CAskFit1Err','CAskFit2Err','PAskFit1Err','PAskFit2Err','CBidFit1Err','CBidFit2Err','PBidFit1Err','PBidFit2Err','CobsSampleErr','NoPrcFit','NumStrikes','CMidFitErr','PMidFitErr','StrikeCount','VolKnotCnt','InterpError','NoAtmStrike','CobsConvexFitErr','CobsMidFitErr','ProxyError','NoOptExp','Expired','NoUnderlier','NoBaseUnderlier','InvalidUPrc','ZeroUPrc','WideUMkt','StalePrcFit','NoPrcCurves','PriceError','ConvergeFail','NoUPrcRatio','NoSDivValue') NOT NULL DEFAULT 'None',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
PRIMARY KEY USING HASH (`ekey_tk`,`ekey_yr`,`ekey_mn`,`ekey_dy`,`ekey_at`,`ekey_ts`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='';